class CA
{
    double getPayAmount() 
    {
        double result;
        if (_isDead) result = deadAmount();
        else {
            if (_isSeparated) result = separatedAmount();
            else {
                if (_isRetired) result = retiredAmount();
                else result = normalPayAmount();
            };
        }
    return result;
    }
  double deadAmount() {return 0.0;} 
  double separatedAmount() {return 0.0;} 
  double retiredAmount() {return 0.0;} 
  double normalPayAmount() {return 0.0;} 
private:
    bool _isDead;
    bool _isSeparated;
    bool _isRetired;

};
